<template>
    <div id="list">
      <el-row :gutter="30">
        <el-col :span="8">
          <div class="grid-content bg-purple">
            <ul>
              <li @click="gotoArticle(newitem.aid)" v-for="(newitem,index) in specialistNewPostList" :key="index" :index="index">
                <svg class="dianIcon icon" aria-hidden="true">
                  <use xlink:href="#iconyuandian"></use>
                </svg>
                &nbsp;<el-link :underline="false">{{newitem.title}}</el-link>
              </li>
            </ul>
          </div>
        </el-col>
        <el-col :span="8">
          <div class="grid-content bg-purple">
            <ul>
              <li @click="gotoArticle(hotitem.aid)" v-for="(hotitem,index) in hotPointTopicList" :key="index" :index="index">
                <svg class="dianIcon icon" aria-hidden="true">
                  <use xlink:href="#iconyuandian"></use>
                </svg>
                &nbsp;<el-link :underline="false">{{hotitem.title}}</el-link>
              </li>
            </ul>
          </div>
        </el-col>
        <el-col :span="8">
          <div class="grid-content bg-purple">
            <ul>
              <li @click="gotoArticle(lookitem.aid)" v-for="(lookitem,index) in mustLookList" :key="index" :index="index">
                <svg class="dianIcon icon" aria-hidden="true">
                  <use xlink:href="#iconyuandian"></use>
                </svg>
                &nbsp;<el-link :underline="false">{{lookitem.title}}</el-link>
              </li>
            </ul>
          </div>
        </el-col>
      </el-row>
    </div>
</template>

<script>
  export default {
    name: "List",
    data () {
      return {
        specialistNewPostList: [],
        hotPointTopicList: [],
        mustLookList: []
      }
    },
    mounted () {
      //专家新发
      this.$http({
        url: '/article/specialistNewPostList',
        method: 'post'
      }).then(res =>{
        this.specialistNewPostList = res.data
      }).catch(err =>{
        console.log(err);
      })

      //热点话题
      this.$http({
        url: '/article/hotPointTopicList',
        method: 'post'
      }).then(res =>{
        this.hotPointTopicList = res.data
      }).catch(err =>{
        console.log(err);
      })

      //入站必看
      this.$http({
        url: '/article/mustLookList',
        method: 'post'
      }).then(res =>{
        this.mustLookList = res.data
      }).catch(err =>{
        console.log(err);
      })
    },
    methods: {
      gotoArticle (aid) {
        this.$router.push('/article/'+aid)
      }
    }
  }
</script>

<style scoped>
  .dianIcon{
    font-size: 16px;
    width: 15px;
    height: 15px;
    margin-bottom: -5px;
  }
  .el-row {
    margin-bottom: 20px;
  }
  .el-col {
    border-radius: 4px;
  }
  .bg-purple-dark {
    background: #99a9bf;
  }
  .bg-purple {
    background: #ffffff;
    border: #beaeae solid 1px;
  }
  .bg-purple-light {
    background: #e5e9f2;
  }
  #list .grid-content {
    border-radius: 4px;
    min-height: 290px;
  }
  .row-bg {
    padding: 10px 0;
    background-color: #f9fafc;
  }
  ul{
    list-style-type: none;
    margin: 0 15px;
    padding: 0;
  }
  ul li{
    border-bottom: #888888 solid 1px;
    padding: 10px 10px;
  }
  .point{
    font-size: 36px;
  }
</style>
